import 'package:safetymonitor/app/core/core.dart';
import 'package:safetymonitor/app/core/ext/widget_extension.dart';

/// 底部确认按钮
class CustomSureSheet extends StatelessWidget {
  const CustomSureSheet({required this.onTap, super.key,this.strName = '确定'});

  final VoidCallback onTap;
  final String strName;
  @override
  Widget build(BuildContext context) {
    return Container(
      height: 50.w,
      alignment: Alignment.center,
      padding: EdgeInsets.symmetric(horizontal: 16.w),
      decoration: BoxDecoration(
        color: Colors.white,
        boxShadow: [
          BoxShadow(
            color: const Color(0xffBCBCC5).withOpacity(0.3), // 阴影颜色
            offset: const Offset(0, -5), // 阴影的偏移量，向上偏移，即上方阴影
            blurRadius: 10.0, // 阴影的模糊半径
            spreadRadius: 2.0, // 阴影的扩散半径
          ),
        ],
      ),
      child: Container(
          height: 40.w,
          alignment: Alignment.center,
          decoration: BoxDecoration(
              color: const Color(0xff5C6DFF),
              borderRadius: BorderRadius.all(
                Radius.circular(20.w),
              )),
          child: Text(
            strName,
            style: TextStyle(
              fontSize: 16.sp,
              color: const Color(0xffffffff),
            ),
          )).clickOnce(onTap),
    );
  }
}
